package com.corewillsoft.fireflies.ui;

import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.background.ColorBackground;

import android.content.Intent;

import com.corewillsoft.fireflies.sounds.SoundsManager;
import com.corewillsoft.fireflies.ui.BaseActivity.OnMenuClickedListener;

public class MainMenuActivity extends BaseActivity implements OnMenuClickedListener {

	@Override
	public void onLoadResources() {
		super.onLoadResources();
	}

	@Override
	public void onLoadComplete() {
		scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));
		showMainMenu(this);
	}

	@Override
	public Scene onLoadScene() {
		scene = new Scene();
		return scene;
	}

	@Override
	public boolean onMenuClicked(MENU type) {
		switch (type) {
		case GAME:
			startActivity(new Intent(MainMenuActivity.this, MapActivity.class));
			return true;
		case ACHIEVEMENTS:
			startActivity(new Intent(MainMenuActivity.this, AchievementsActivity.class));
			return true;
		case EXIT_GAME:
			SoundsManager.getInstance().releaseAll();
			finish();
			return true;
		default:
			return false;
		}
	}

	@Override
	protected void pauseGame() {
	}

	@Override
	protected void resumeGame() {
	}

	@Override
	protected void onHardKeyMenuPressed() {
	}

	@Override
	public void onHardKeyBackPressed() {
		SoundsManager.getInstance().releaseAll();
	}
}
